public class QuizCheck
{
   /**
      Checks whether a string of quiz answers is valid. It must 
      contain an answer A, B, C, or D for each expected answer, or an 
      X to indicate that no answer was provided.
      @param input the answer string
      @param questions the number of questions in the string
      @return true if the string was valid, false otherwise
   */
   public static boolean checkInputs(String input, int questions)
   {
      if(input.length() != questions)
         return false;
      else
         for(int i = 0; i < input.length(); i++)
         {
            char a = input.charAt(i);
            switch(a)
            {
               case 'A' : break;
               case 'B' : break;
               case 'C' : break;
               case 'D' : break;
               case 'X' : break;
               default: return false; 
            }
         }
         return true;
   }
}